Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix printf compiler warning #201

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

rfl890
Copy link

@rfl890 rfl890 commented Aug 10, 2024

An incorrect format specifier is used in cache.c (%lu instead of %zu for size_t) causing a compiler warning in Clang:

C:/Users/RFL890/zopfli/src/zopfli/cache.c:37:9: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned long long') [-Wformat]
   36 |         "Error: Out of memory. Tried allocating %lu bytes of memory.\n",
      |                                                 ~~~
      |                                                 %zu
   37 |         (unsigned long)ZOPFLI_CACHE_LENGTH * 3 * blocksize);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

This PR fixes it by using the correct format specifier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant